﻿<div id="tabs-right" style="margin-top: 12px;">
           
            <?php if(isset($pid)): ?>
            <h2 class="cattitle"><?php echo $this->lang->line('category') ?></h2>
                <ul class="sub_menu">
                
                    <?php 
                        $categories = _get_category_parent_id($pid,false);
						
                        if(!empty($categories)){
                            $str2='';
                            $p_id = $this->uri->rsegment(3);
                            foreach($categories as $cat){
                                $active ='';
                                if($p_id==$cat->cat_id){
                                    $active = 'class="actived"';
                                }
                                $name = $this->_global->_unserialize($cat->cat_name);
                                $alias = $this->_global->_unserialize($cat->cat_alias);
                                $type = $cat->cat_type;
                                if($type=='article') $type='news';
                                if($type=='profile'){
                                 
                                    $galleries = _get_profile($cat->cat_id);
                                   
                                    if(!empty($galleries)){
                                        $str2='<ul>';
                                        foreach($galleries as $gallery){
                                            if($this->uri->rsegment(5) == $gallery->post_id){
                                                $class='class="actived"';   
                                            }else
                                                $class='';
                                            $title = $this->_global->_unserialize($gallery->post_title);
                                            $alias = $this->_global->_unserialize($gallery->seo_alias);
                                            $str2.='<li>'.anchor('profile/c'.$gallery->cat_id.'/'.$alias[$this->session->userdata('lan')]['alias'].'-'.$gallery->post_id,$title[$this->session->userdata('lan')]['post_title'],$class.' title="'.$title[$this->session->userdata('lan')]['post_title'].'"').'</li>';
                                        }
                                        $str2.='</ul><div class="clear"></div>';
                                        $alias =  $this->_global->_unserialize($galleries[0]->seo_alias);
                                        echo '<li>'.anchor($type.'/c'.$gallery->cat_id.'/'.$alias[$this->session->userdata('lan')]['alias'].'-'.$galleries[0]->post_id,'<span>&raquo; </span>'.$name[$this->session->userdata('lan')]['title'],$active.' title="'.$name[$this->session->userdata('lan')]['title'].'"').$str2.'</li>'; 
                                    }
                                    
                                }
								
								elseif($type=='gallery'){
                                 
                                    $galleries = _get_gallery($cat->cat_id);
                                   
                                    if(!empty($galleries)){
                                        $str2='<ul>';
                                        foreach($galleries as $gallery){
                                            if($this->uri->rsegment(5) == $gallery->post_id){
                                                $class='class="actived"';   
                                            }else
                                                $class='';
                                            $title = $this->_global->_unserialize($gallery->post_title);
                                            $alias = $this->_global->_unserialize($gallery->seo_alias);
                                            $str2.='<li>'.anchor('gallery/c'.$gallery->cat_id.'/'.$alias[$this->session->userdata('lan')]['alias'].'-'.$gallery->post_id,$title[$this->session->userdata('lan')]['post_title'],$class.' title="'.$title[$this->session->userdata('lan')]['post_title'].'"').'</li>';
                                        }
                                        $str2.='</ul><div class="clear"></div>';
                                        $alias =  $this->_global->_unserialize($galleries[0]->seo_alias);
                                        echo '<li>'.anchor($type.'/c'.$gallery->cat_id.'/'.$alias[$this->session->userdata('lan')]['alias'].'-'.$galleries[0]->post_id,'<span>&raquo; </span>'.$name[$this->session->userdata('lan')]['title'],$active.' title="'.$name[$this->session->userdata('lan')]['title'].'"').$str2.'</li>'; 
                                    }
                                    
                                }
                                else
                                    echo '<li>'.anchor($type.'/'.$alias[$this->session->userdata('lan')]['alias'].'-'.$cat->cat_id,'<span>&raquo; </span>'.$name[$this->session->userdata('lan')]['title'],$active.' title="'.$name[$this->session->userdata('lan')]['title'].'"').$str2.'</li>';
                                $str2='';
                            }
                        }else{
                            $cat =$this->categories->getCat(array('cat_id'=>$pid));;
                         
                            $str2='';
                            $p_id = $this->uri->rsegment(3);
                            
                                $active ='';
                                if($p_id==$cat->cat_id){
                                    $active = 'class="actived"';
                                }
                              
                                $name = $this->_global->_unserialize($cat->cat_name);
                                
                                $alias = $this->_global->_unserialize($cat->cat_alias);
                                $type = $cat->cat_type;
                                if($type=='article') $type='news';
                                if($type=='profile'){
                                 
                                    $galleries = _get_profile($cat->cat_id);
                                   
                                    if(!empty($galleries)){
                                        $str2='<ul>';
                                        foreach($galleries as $gallery){
                                            if($this->uri->rsegment(5) == $gallery->post_id){
                                                $class='class="actived"';   
                                            }else
                                                $class='';
                                            $title = $this->_global->_unserialize($gallery->post_title);
                                            $alias = $this->_global->_unserialize($gallery->seo_alias);
                                            $str2.='<li>'.anchor('profile/c'.$gallery->cat_id.'/'.$alias[$this->session->userdata('lan')]['alias'].'-'.$gallery->post_id,$title[$this->session->userdata('lan')]['post_title'],$class.' title="'.$title[$this->session->userdata('lan')]['post_title'].'"').'</li>';
                                        }
                                        $str2.='</ul><div class="clear"></div>';
                                        $alias =  $this->_global->_unserialize($galleries[0]->seo_alias);
                                        echo '<li>'.anchor($type.'/c'.$gallery->cat_id.'/'.$alias[$this->session->userdata('lan')]['alias'].'-'.$galleries[0]->post_id,'<span>&raquo; </span>'.$name[$this->session->userdata('lan')]['title'],$active.' title="'.$name[$this->session->userdata('lan')]['title'].'"').$str2.'</li>'; 
                                    }
                                    
                                }elseif($type=='gallery'){
                                 
                                    $galleries = _get_gallery($cat->cat_id);
                                   
                                    if(!empty($galleries)){
                                        $str2='<ul>';
                                        foreach($galleries as $gallery){
                                            if($this->uri->rsegment(5) == $gallery->post_id){
                                                $class='class="actived"';   
                                            }else
                                                $class='';
                                            $title = $this->_global->_unserialize($gallery->post_title);
                                            $alias = $this->_global->_unserialize($gallery->seo_alias);
                                            $str2.='<li>'.anchor('gallery/c'.$gallery->cat_id.'/'.$alias[$this->session->userdata('lan')]['alias'].'-'.$gallery->post_id,$title[$this->session->userdata('lan')]['post_title'],$class.' title="'.$title[$this->session->userdata('lan')]['post_title'].'"').'</li>';
                                        }
                                        $str2.='</ul><div class="clear"></div>';
                                        $alias =  $this->_global->_unserialize($galleries[0]->seo_alias);
                                        echo '<li>'.anchor($type.'/c'.$gallery->cat_id.'/'.$alias[$this->session->userdata('lan')]['alias'].'-'.$galleries[0]->post_id,'<span>&raquo; </span>'.$name[$this->session->userdata('lan')]['title'],$active.' title="'.$name[$this->session->userdata('lan')]['title'].'"').$str2.'</li>'; 
                                    }
                                    
                                }
                                else
                                    echo '<li>'.anchor($type.'/'.$alias[$this->session->userdata('lan')]['alias'].'-'.$cat->cat_id,'<span>&raquo; </span>'.$name[$this->session->userdata('lan')]['title'],$active.' title="'.$name[$this->session->userdata('lan')]['title'].'"').$str2.'</li>';
                                $str2='';
                            
                        }
                    ?>
                </ul><?php endif; ?>
            <div class="clear">
            
			<h2 class="cattitle"><?php echo $this->lang->line('support') ?></h2>
			<?php
			global $site_info;
                    $yahoos = str_replace('"','',$site_info['yahoo_support']);
					
                    if(!empty($yahoos)){
                        $yahoos = explode(',',$yahoos);
                        foreach($yahoos as $yahoo){
$yahoo = explode('|',$yahoo);
                            echo '<a  style="float:left;padding:0 6px;margin-top:5px" title="'.$yahoo[1].'" href="ymsgr:sendIM?'.$yahoo[0].'"><img src="http://opi.yahoo.com/online?u='.$yahoo[0].'&m=g&t=5"/>  '.$yahoo[1].'</a>';
                        }
                    }
                 ?>
                 
			</div>
            
                <?php 
                
                   if(isset($right_banners)){
            ?>
            <div class="clear" style="padding-top: 10px;">
            <?php 
                    foreach($right_banners as $bn){
                    echo "<div style='margin-bottom:5px'><a href='".$bn->link."'  title='".$bn->name."' target='_blank'><img alt='".$bn->name."' title='".$bn->name."' src='".str_replace('cdn/',$this->config->item('cdn_url'),$bn->image)."' width=280' /></a></div>";
                    }
                ?>
            </div>
            <?php
                   }
                ?>  <?php 
                   if(isset($cat_banners)){
            ?>
            <div class="clear">
                <?php 
                    foreach($cat_banners as $bn){
                    echo "<div style='margin-bottom:5px'><a href='".$bn->link."'  title='".$bn->name."' target='_blank'><img alt='".$bn->name."' title='".$bn->name."' src='".str_replace('cdn/',$this->config->item('cdn_url'),$bn->image)."' width=280' /></a></div>";
                    }
                ?>
            </div>
            <?php
                   }
                ?>
        </div>
        